package com.zhouyu.service;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

@Component
public class UserService implements InitializingBean,UserServiceInterface {


	private OrderServiceInterface orderService;

	@Value("zhouyu")
	private String zhouyu;

	@Autowired
	private User userFromFactory;

	@Override
	public void setOrderService(OrderServiceInterface orderService) {
		this.orderService = orderService;
	}

	public void test() {
		System.out.println(orderService);
	}


	@PostConstruct
	public void init(){
		System.out.println(1);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println(2);
	}
}
